<template>
  <ul>
    <li v-for="stu in students" :key="stu.name">{{ stu.name }}</li>
  </ul>
</template>

<script setup lang="ts" name="Student">
  import { defineProps, withDefaults } from 'vue'
  import { type Person } from '@/types/Person'
  // defineProps defineXxxx其实都是宏函数，可以不用特意引入
  // defineProps(['students'])
  // defineProps<{students?: Person[]}>()
  withDefaults(defineProps<{students?: Person[]}>(), {
    students: () => []
  })
</script>

<style>
</style>